home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BCI NET
/
BCI NET Dec 94.iso
/
archives
/
applications
/
wp
/
macro.lha
/
Macro
/
SAS
/
findsym.ged
next >
Wrap
Text File
|
1994-09-05
|
2KB
|
83 lines
/* findsym.ged V1.0 "
written in 1994 by Leu Simon GRIS
10 bis AVE. du Maréchal LECLERC
F-63000 Clermont Ferrand
France
Description:
AREXX Script for GoldED
Search in the Include:gst.all file for the symbol
under the cursor. If found, load the corresponding
include file at the right line.
Notes:
This is mainly based on the findsym.se script provided with
SAS/C 6.50
*/
OPTIONS RESULTS /* enable return codes */
if (LEFT(ADDRESS(), 6) ~=3D "GOLDED") then /* not started by GoldEd ? */
address 'GOLDED.1'
'LOCK CURRENT' /* lock GUI, gain access */
OPTIONS FAILAT 6 /* ignore warnings */
SIGNAL ON SYNTAX /* ensure clean exit */
/* ------------------------ INSERT YOUR CODE HERE: ------------------- */
'QUERY NAME=3DWORD VAR=3Dresult' /* Get current word */
OPTIONS
parm =3D result
ADDRESS command
/* Proceed to the search if there is something under the cursor */
IF (LENGTH(parm) ~=3D 0) THEN
DO
/* Instruct gst to find the symbol */
'sc:c/gst >t:gstout include:all.gst "' || parm || '"'
gstrc =3D rc
/* Read what gst replyed */
dummy1 =3D open('gstout','t:gstout','read')
where =3D readln('gstout')
dummy1 =3D close('gstout')
ADDRESS
/* If gst was successfull */
IF(gstrc =3D=3D 0) then do
/* Open the file */
parse var where file dummy1 line dummy2
'OPEN NAME=3D"' || file || '" NEW FAST'
window =3D rc
/* Goto the line */
'GOTO LINE=3D' || line + 1
END
ELSE DO
'REQUEST PROBLEM=3D"'parm'|Symbol not found"'
END
END
ELSE
DO
ADDRESS
'REQUEST PROBLEM=3D"You must place the|cursor over a symbol"'
END
w
/* ---------------------------- END OF YOUR CODE --------------------- */
'UNLOCK' /* VERY important: unlock GUI */
EXIT
SYNTAX:
SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
'UNLOCK'
EXIT